<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        body {
            margin: 0;
            padding: 0;
            height: 200vh;
            overflow-x: hidden;
        }

        h1 {
            width: 100%;
            margin: 0 auto;
            text-align: center;
            letter-spacing: 14px;
        }

        h2 {
            position: absolute;
            letter-spacing: 2px;
            top: 120vh;
            color: #fff;
            padding: 30px;
        }

        .background {
            background-image: url("./bg.jpeg");
            background-size: cover;
            background-position: 50% 50%;
            height: 200vh;
            font: 900 30rem '';
            -webkit-text-fill-color: transparent;
            -webkit-background-clip: text;
            text-align: center;
            position: relative;
            overflow: hidden;
        }

        .background::before {
            content: '';
            background-size: cover;
            background-image: inherit;
            background-position: 50% 50%;
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            z-index: -99;
        }
    </style>
</head>

<body>
    <h1>cjh</h1>
    <div class="background">Dota2</div>
    <h2>
        文章包括各种文体的著作、作品，如诗歌、戏剧、小说、科学论文，记叙文、议论文、说明文、应用文等等。“千古文章未尽才”“文章千古事”“文章憎命达”“板凳要坐十年冷、文章不写一字空”“积句而成章，积章而成篇”“言出为论，下笔成章”等，都是现在所说的文章的意思。更广义的文章，也包含“学问”“奥秘”等意思，如“洞明世事皆学问，人情练达即文章”就是。
    </h2>
    <script>
        const background = document.querySelector('.background')

        document.addEventListener('scroll', () => {
            const scrollY = window.scrollY
            background.style.backgroundPosition = `calc(50% + ${scrollY / 2}px) calc(50% + ${scrollY / 2}px)`
        })
    </script>
</body>

</html>